package com.itheima.reggie.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.reggie.domain.Category;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author zsk
 * @create 2022-03-01-11:27
 */
@Repository
public interface CategoryMapper extends BaseMapper<Category> {

    //查询分类列表
    List<Category> findAll();

    //新增菜品分类
    void save(Category category);

    //修改菜品分类信息
    void update(Category category);

    //查询当前分类下是否存在菜品
    Integer contDishByCategoryId(Long categoryId);

    //查询当前分类下是否存在套餐
    Integer countSetmealCategoryId(Long categoryId);

    //根据id删除分类信息
    void deleteById(Long id);
}
